package com.rbc.rlslips.object.builder;

import org.apache.log4j.Logger;

import ca.qc.gouv.mrq.t1a._04111900.annuaire.ArrayOfObtenirUrlServiceIN;
import ca.qc.gouv.mrq.t1a._04111900.annuaire.ObtenirUrlServiceIN;
import ca.qc.gouv.mrq.t1a._04111900.communs.ContexteSession;

import com.rbc.rlslips.enums.PropertiesKeysEnum;
import com.rbc.rlslips.logger.RLLogger;
import com.rbc.rlslips.properties.manager.PropertiesReader;

public final class ObjectBuilder {
	
	private static Logger logger = Logger.getLogger(ObjectBuilder.class);
	
	public static ContexteSession buildContexteSession(){
		RLLogger.info(logger,"Entered buildContexteSession");
		ContexteSession contexteSession = new ContexteSession();
		contexteSession.setNoTed(PropertiesReader.getProperty(PropertiesKeysEnum.SOAP_HEADER_NOTED_KEY));
		contexteSession.setNoUsager(PropertiesReader.getProperty(PropertiesKeysEnum.SOAP_HEADER_NOUSAGER_KEY));
		contexteSession.setCodeService(PropertiesReader.getProperty(PropertiesKeysEnum.SOAP_HEADER_CODESERVICE_KEY));
		contexteSession.setNoVersionService(PropertiesReader.getProperty(PropertiesKeysEnum.SOAP_HEADER_NO_VERSION_SERVICE_KEY));
		contexteSession.setIdPartenaire(PropertiesReader.getProperty(PropertiesKeysEnum.SOAP_HEADER_IDPARTENAIRE_KEY));
		contexteSession.setIdLogiciel(PropertiesReader.getProperty(PropertiesKeysEnum.SOAP_HEADER_IDLOGICIEL_KEY));
		contexteSession.setNoSerieLogiciel(PropertiesReader.getProperty(PropertiesKeysEnum.SOAP_HEADER_NOSERIELOGICIEL_KEY));
		RLLogger.info(logger,"Exited buildContexteSession",contexteSession);
		return contexteSession;
	}
	
	public static ArrayOfObtenirUrlServiceIN buildArrayOfObtenirUrlServiceIN(){
		RLLogger.info(logger,"Entered buildArrayOfObtenirUrlServiceIN");
		ArrayOfObtenirUrlServiceIN obtenirUrlServiceIN=new ArrayOfObtenirUrlServiceIN();
		ObtenirUrlServiceIN code1=new ObtenirUrlServiceIN();
		code1.setCodeService(PropertiesReader.getProperty(PropertiesKeysEnum.CODE_SERVICE_SW1071_KEY));
		ObtenirUrlServiceIN code2=new ObtenirUrlServiceIN();
		code2.setCodeService(PropertiesReader.getProperty(PropertiesKeysEnum.CODE_SERVICE_SW1072_KEY));
		obtenirUrlServiceIN.getObtenirUrlServiceIN().add(code1);
		obtenirUrlServiceIN.getObtenirUrlServiceIN().add(code2);
		RLLogger.info(logger,"Exited buildArrayOfObtenirUrlServiceIN",obtenirUrlServiceIN);
		return obtenirUrlServiceIN;
		
	}

}
